//  https://www.luogu.com.cn/problem/P2918

#include<iostream>
#include<cstring>
using namespace std;

const int N = 110, M = 50010;
int p[M], c[M];
int dp[N][M];
int n, h;

int main()
{
    cin >> n >> h;
    for (int i = 1;i <= n;i++) cin >> p[i] >> c[i];

    memset(dp, 0x3f, sizeof dp);
    dp[0][0] = 0;
    for (int i = 1;i <= n;i++)
    {
        for (int j = 0;j <= h;j++)
            dp[i][j] = min(dp[i - 1][j], dp[i][max(0, j - p[i])] + c[i]);
    }
    cout << dp[n][h] << endl;
    return 0;
}